/*
 * Copyright 2008 Nathan C Jones
 * 
 * This file is part of Fivehundred.
 * 
 * Fivehundred is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * Fivehundred is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * Fivehundred. If not, see <http://www.gnu.org/licenses/>. 
 */
package com.googlecode.fivehundred.model;

import com.googlecode.fivehundred.model.Card;
import com.googlecode.fivehundred.model.CardCollection;
import com.googlecode.fivehundred.model.CardCollectionListener;

/**
 * A card collection listener which records the card added or removed.
 * 
 * @author Nathan C Jones
 */
final class HelperCollectionListener implements CardCollectionListener {
	private Card  addedCard;
	
	private Card removedCard;
	
	private boolean isCardRemoved = false;
	
	private boolean isCardAdded = false;

	@Override
	public void cardAdded(Card card, CardCollection collection) {
		isCardAdded = true;
		addedCard = card;
	}

	public void cardRemoved(Card card, CardCollection collection) {
		isCardRemoved = true;
		removedCard = card;
	}

	public Card getAddedCard() {
		return addedCard;
	}

	public Card getRemovedCard() {
		return removedCard;
	}

	public boolean isCardRemoved() {
		return isCardRemoved;
	}

	public boolean isCardAdded() {
		return isCardAdded;
	}
}